#Copyright (c) WanSheng Intelligent Corp. All rights reserved.
#Licensed under the MIT license. See LICENSE file in the project root for full license information.

cmake_minimum_required(VERSION 2.8.11)
message("hello service sample...")
project(hello_service)


if(NOT DEFINED WA_SDK_DIR)
  set (WA_SDK_DIR  ${CMAKE_CURRENT_LIST_DIR}/../../../out/host/wa-iot)
endif()
include(${WA_SDK_DIR}/wa-sdk.cmake)

include_directories(
    ${CMAKE_CURRENT_SOURCE_DIR}/inc
)

set(hello_world_sources
    ${CMAKE_CURRENT_SOURCE_DIR}/src/hello_world.c
    ${CMAKE_CURRENT_SOURCE_DIR}/src/resources.c
    ${CMAKE_CURRENT_SOURCE_DIR}/src/module_entry.c
)

# Tell the loader to look up the dependent dynamic libraries from the same folder.
set(CMAKE_INSTALL_RPATH "$ORIGIN;/usr/local/lib")
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)

#this builds the hello_world dynamic library
add_library(hello_world_service MODULE ${hello_world_sources} ${hello_world_headers})
linkWA_SDK(hello_world_service)

